
/***********************************************/
/*     framebuffer.h     Framebuffer Class     */
/*                       By: Josh Fiorio       */
/***********************************************/

#ifndef _FRAMEBUFFER_H_
#define _FRAMEBUFFER_H_

/* c++ libraries */
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define BYTE unsigned char
#ifndef RGB
#define RGB(r,g,b) (((BYTE)(r)|((BYTE)(g) << 8)|((BYTE)(b) << 16)))
#endif /* RGB */

extern long pcolor;

class FrameBuffer
{ 
public: 
	 unsigned char *framebuffer;
	 
	 int width;
	 int height;
	 
 	 int bpp;
	 
	 void Init(int, int);
	 void Init(int, int, int);

	 void Delete() {free(framebuffer);}
     void SetPixel(int x, int y, unsigned int color);
	 long GetPixel(int, int);
	 void Clear();
};

/* function prototypes */
void MagBuf(FrameBuffer &, int, FrameBuffer &, int);                     //l    single
void CopyBuf(FrameBuffer &, FrameBuffer &);                              //l    single
void ShiftBuf(FrameBuffer &, long x, long y);                            //l    single

#endif /* _FRAMEBUFFER_H_ */
